#include <stdio.h>

int reverse(int number);

int main()
{
    int n;

    scanf("%d", &n);
    printf("%d\n", reverse(n));

    return 0;
}

/* 你的代码将被嵌在这里 */
int reverse(int number)
{
    int result = 0;
    int temp, negative = 0;
    if (number < 0)
    {
        negative = 1;
        number = -number;
    }
    while (number > 0)
    {
        temp = number / 10;
        result += temp;
        result *= 10;
    }
    if (negative == 1)
        result *= -1;
    return result;
}